<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<input id="num1" />+<input id="num2" />
		<input type="button" value="=" onclick="jisuan()" />
		<input id="num3" />
		<script>
			var jisuan=function(){
			if(isNaN(num1.value)==true||
			isNaN(num2.value)==true){
				alert("请您输入合法的数字");
			}else{
				num3.value=parseFloat(num1.value)+parseFloat(num2.value);
				}
			}
		</script>
	</body>
</html>
